<?php
namespace common\models\goods;

use Yii;
use yii\db\ActiveRecord;
//use yii\behaviors\TimestampBehavior;
use common\enums\StatusEnum;
use common\helpers\RegularHelper;

class AttrValue extends ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%attribute_value}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['store_id', 'attr_value_name'], 'required'],
            [['member_id','store_id','attr_id','attr_value_sort','is_show'], 'integer'],
            [['attr_value_name'], 'string', 'max' => 40],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'attr_value_id' => 'ID',
            'member_id' => '用户ID',
            'store_id' => '店铺ID',
            'attr_value_name' => '属性名',
            'attr_id'=>'属性ID',
            'attr_value_sort' => '排序',
            'is_show' => '是否显示'
        ];
    }

    /**
     * 场景
     *
     * @return array
     */
    public function scenarios()
    {
        return [
//            'create' => [''],
//            'backendCreate' => ['username', 'password_hash'],
            'default' => array_keys($this->attributeLabels()),
        ];
    }

}
